Skip to content

Add color thresholds to the Info Display#693

Merged
marionbarker merged 4 commits into
devfrom
feature/info-display-color-thresholds
Jul 19, 2026
Merged

Add color thresholds to the Info Display#693
marionbarker merged 4 commits into
devfrom
feature/info-display-color-thresholds

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 7, 2026

Copy link
Copy Markdown
Member

Closes #691.

Info Display rows can now turn yellow or red when their value crosses a user-set threshold — a purely visual cue, no alarm. Supported rows: IOB, COB, battery, pump battery, TDD, rec bolus, carbs today, and sensor/cannula/insulin ages. The concerning direction is fixed per metric (battery colors when low, ages when high) and in-range values read green.

Under the hood the parallel infoSort/infoVisible arrays are replaced by a single ordered [InfoDisplayItem] store (one-time migration via migrateStep10, plus a safety-net conversion in synchronizeInfoTypes). The Info Display settings screen is reworked into drill-in rows that stay reorderable while also opening a per-row detail (visibility + colors).

Individual info rows (IOB, COB, battery, pump battery, TDD, rec bolus,
carbs, and sensor/cannula/insulin ages) can now turn yellow or red when
their value crosses user-set thresholds — a visual cue only, with no
alarm. The concerning direction is fixed per metric (battery colors when
low, ages when high) and in-range values read green.

Replaces the parallel infoSort/infoVisible arrays with a single ordered
[InfoDisplayItem] store (migrated via migrateStep10), and reworks the
Info Display settings into drill-in rows that reorder and open a per-row
detail at the same time.
@bjorkert bjorkert linked an issue Jul 7, 2026 that may be closed by this pull request
bjorkert added 2 commits July 8, 2026 09:53
Threshold entry now uses steppers with a per-type range and step, mirroring
the alarm editors, so values that need decimals (IOB, rec. bolus, the ages)
accept them. The old text fields re-parsed on every keystroke and swallowed
the decimal separator, making fractional thresholds impossible to enter.

Direction, unit, bounds and defaults move into a single InfoColorConfig per
type, so isColorable is simply "has a config".

The pump reservoir row is now colorable, low-is-concerning. Pumps that only
report "50+" count as exactly 50, matching what the reservoir alarm already
does with latestPumpVolume.
…olor-thresholds

# Conflicts:
#	LoopFollow/InfoTable/InfoType.swift
#	LoopFollow/Storage/Storage+Migrate.swift
@marionbarker

Copy link
Copy Markdown
Collaborator

Test

Once I was told how to enable this, it worked as expected. It should have been obvious but I missed seeing it in the Information Table settings.

Ready to merge once conflicts are resolved.

…olor-thresholds

# Conflicts:
#	LoopFollow/Controllers/Nightscout/DeviceStatusLoop.swift
#	LoopFollow/Storage/Storage.swift

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve by code review and test. (Test repeated after last push).

@marionbarker
marionbarker merged commit c56d0b3 into dev Jul 19, 2026
1 check passed
@marionbarker
marionbarker deleted the feature/info-display-color-thresholds branch July 19, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New feaure idea: Info Display Color

2 participants